<template>
  <Input
    type="text"
    v-model="searchValue"
    :placeholder="
      config.placeholder ? config.placeholder : '请输入' + config.label
    "
    :maxlength="config.maxlength ? config.maxlength : ''"
    :readonly="config.readonly"
    :disabled="config.disabled"
    clearable
    @on-focus="config.onFocus"
    size="default"
  ></Input>
</template>

<script setup>
import { computed } from 'vue'
const props = defineProps(['model', 'config'])
const emit = defineEmits(['update'])

const searchValue = computed({
  get() {
    return props.model
  },
  set(value) {
    emit('update', props.config, value)
  },
})
</script>

<style lang="less" scoped>
:deep(.ivu-input) {
  padding-left: 10px;
  border-radius: 20px;
  font-size: 13px;
}
</style>
